package cn.wolfcode.enums;

import lombok.Getter;

@Getter
public enum BusinessReportEnum {
    CONSUME("门店","b.name"),
    AUDIT("年","DATE_FORMAT(create_time,'%Y')"),
    FINISH("月","DATE_FORMAT(create_time,'%Y-%m')"),
    FAILURE("日","DATE_FORMAT(create_time,'%Y-%m-%c')");


    BusinessReportEnum(String name, String value) {
        this.name = name;
        this.value = value;
    }

    private String name;
    private String value;

    public static String findName(String value) {
        BusinessReportEnum[] enums = values();
        for (BusinessReportEnum anEnum : enums) {
            if (anEnum.value.equals(value)) {
                return anEnum.name;
            }
        }
        return null;
    }
}
